package com.muyu.cloud.commodity.domain.resp;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 商品统计响应
 * @author muyu
 * @date 2025/01/20
 */
@Data
@Schema(description = "商品统计响应")
public class ProductStatsResp {

    @Schema(description = "商品浏览量")
    private Long viewCount;

    @Schema(description = "商品数量")
    private Long productCount;

    @Schema(description = "总销量")
    private Long totalSales;

    @Schema(description = "总销售额")
    private BigDecimal totalAmount;

    @Schema(description = "环比增长数据")
    private GrowthData growthData;

    @Schema(description = "趋势数据")
    private List<TrendData> trendData;

    @Schema(description = "商品排行")
    private List<ProductRanking> productRanking;

    @Data
    @Schema(description = "环比增长数据")
    public static class GrowthData {
        @Schema(description = "浏览量环比增长")
        private Double viewCountGrowth;

        @Schema(description = "商品数量环比增长")
        private Double productCountGrowth;

        @Schema(description = "销量环比增长")
        private Double salesGrowth;

        @Schema(description = "销售额环比增长")
        private Double amountGrowth;
    }

    @Data
    @Schema(description = "趋势数据")
    public static class TrendData {
        @Schema(description = "日期")
        private String date;

        @Schema(description = "商品浏览量")
        private Long viewCount;

        @Schema(description = "商品数量")
        private Long productCount;

        @Schema(description = "总销量")
        private Long totalSales;

        @Schema(description = "总销售额")
        private BigDecimal totalAmount;
    }

    @Data
    @Schema(description = "商品排行")
    public static class ProductRanking {
        @Schema(description = "商品ID")
        private Long productId;

        @Schema(description = "商品名称")
        private String productName;

        @Schema(description = "商品图片")
        private String productPic;

        @Schema(description = "浏览量")
        private Long viewCount;

        @Schema(description = "收藏数")
        private Long collectCount;

        @Schema(description = "销量")
        private Long sales;

        @Schema(description = "销售额")
        private BigDecimal amount;

        @Schema(description = "排名")
        private Integer ranking;
    }
}



